package com.example.p33;

/**
 * @author Lenovo
 */
public class Main {
    static void vaTest(int ... no) {
        System.out.print("vaTest(int ...): "
                + "参数个数: " + no.length +" 内容: ");
        for(int n : no) {
            System.out.print(n + " ");
        }
        System.out.println();
    }
    static void vaTest(boolean ... bl) {
        System.out.print("vaTest(boolean ...) " +
                "参数个数: " + bl.length + " 内容: ");
        for(boolean b : bl) {
            System.out.print(b + " ");
        }
        System.out.println();
    }
    static void vaTest(String msg, int ... no) {
        System.out.print("vaTest(String, int ...): " +
                msg +"参数个数: "+ no.length +" 内容: ");
        for(int  n : no) {
            System.out.print(n + " ");
        }
        System.out.println();
    }
    public static void main(String args[]){
        vaTest(1, 2, 3);
        vaTest("测试: ", 10, 20);
        vaTest(true, false, false);
    }

    /**
     * @author Lenovo
     */
    public static class Diamond {
        public static void main(String[] args) {
            print(8);
            //输出8行的菱形
        }

        public static void print(int size) {
            if (size % 2 == 0) {
                size++;
                //计算菱形大小
            }
            for (int i = 0; i < size / 2+1; i++) {
                for (int j = size / 2+1; j > i+1; j--) {
                    System.out.print(" ");
                    //输出左上角位置的空白
                }
                for (int j = 0; j < 2 * i + 1; j++) {
                    System.out.print("*");
                    //输出菱形上半部边缘
                }
                System.out.println();
                //换行
            }
            for (int i = size / 2+1; i<size; i++) {
                for (int j = 0; j < i-size/2; j++) {
                    System.out.print(" ");
                    //输出左下角位置的空白
                }
                for (int j = 0; j < 2 * size - 1-2 * i ; j++) {
                    System.out.print("*");
                    //输出菱形下半部边缘
                }
                System.out.println();
            }

        }
    }
}